package com.mks.demo.utils;

public class IdWorkFactory {
    private static IdWorker rdWorker;
    private static IdWorker sysWorker;

    static {
        rdWorker = new IdWorker(1);
        sysWorker = new IdWorker(2);
    }

    public static synchronized IdWorker getRdWork() {
        if (rdWorker == null) {
            rdWorker = new IdWorker(1);
        }
        return rdWorker;
    }

    public static synchronized IdWorker getSysWork() {
        if (sysWorker == null) {
            sysWorker = new IdWorker(2);
        }
        return sysWorker;
    }
}
